<script setup>
//在script中获取传递过来的params参数(动态路由参数)借助useRouter的hooks函数
import {useRoute} from "vue-router";

const route = useRoute()
console.log(route.params.userId)
</script>

<template>
  <div class="user">
    <div class="layui-panel">
      <!--在模板中获取传递过来的params参数(动态路由参数)-->
      <div style="padding: 32px;">用户的id是：{{ $route.params.userId }}</div>
    </div>
  </div>
</template>

<style scoped lang="less">

</style>